package com.lhgg.examol.emp.service;

import java.util.List;

import com.lhgg.examol.emp.bean.Users;
import com.lhgg.examol.emp.dao.EmpDao;
import com.lhgg.examol.util.PageUtil;

public class EmpService {
	private EmpDao dao;

	public EmpDao getDao() {
		return dao;
	}

	public boolean addUser(Users user) {
		return dao.add(user);
	}

	public boolean addUsers(List<Users> users) {
		return dao.addBatch(users);
	}

	public boolean deleteUser(String userId) {
		return dao.delete(userId);
	}

	public boolean updateUser(Users user) {
		return dao.update(user);
	}

	public List<Users> getAllUsers() {
		return dao.getAll();
	}

	public int getCount() {
		return dao.getCount();
	}

	public PageUtil<Users> getPage(PageUtil<Users> pageUtil) {
		return pageUtil.setList(dao.getPage(pageUtil));
	}

	public void setDao(EmpDao dao) {
		this.dao = dao;
	}

	public List getAll() {
		return dao.getAll();
	}
}
